-- CALC_PUZZLE_BOX_BONUS

-- 罐子奖励
-- @type 罐子类型
-- @seed 随机数
---///// 这个公式废弃掉了
return function(puzzleType, seed, campId)
    if true then
        return;
    end

    local classId;
    local amount;
    local arr = {};
    local gemArr = {};
    -- 可抽取的碎片
    local commonTypes = FormulaM.invoke("CALC_POT_PET_RANGE");
    local i;
    for i = 1, #commonTypes do
        arr = table.append(arr, PetM.getTypeSlimeList(commonTypes[i], true));
        gemArr = table.append(gemArr, PetM.getFetchSlimeList(campId, commonTypes[i], true));
    end

    table.sort(arr);
    table.sort(gemArr);

    local prop;
    -- 抽取迷宫外随机数
    local seed2 = RandomFactoryM.myRandom(ME.user);
    local rank;

    if puzzleType == "gem" then
        classId = gemArr[1 + seed % #gemArr];
        amount = 5;

        -- 开罐子额外获得碎片
        prop = PropM.combine(ME.user, "use_pot", "1512");
        if seed2 % 1000 < PropM.apply(prop, 1) then
            amount = amount + 1;
            -- 佣兵首领天赋
            local usePotTrigger = ME.user.dbase:queryTemp("use_pot_trigger") or {};
            table.insert(usePotTrigger, {classId, 1, 5});
            ME.user.dbase:setTemp("use_pot_trigger", usePotTrigger);
        end
    else
        local seed3 = RandomFactoryM.myRandom(ME.user);
        if seed3 % 1000 < 100 then
            -- 普通碎片
            classId = arr[1 + seed % #arr];
            amount = 3;

            -- 开罐子额外获得碎片
            prop = PropM.combine(ME.user, "use_pot", "1511");
            if seed2 % 1000 < PropM.apply(prop, 1) then
                amount = amount + 1;
                -- 塔罗牌天赋
                local usePotTrigger = ME.user.dbase:queryTemp("use_pot_trigger") or {};
                table.insert(usePotTrigger, {classId, 1, 3});
                ME.user.dbase:setTemp("use_pot_trigger", usePotTrigger);
            end
        elseif seed3 % 1000 < 400 then
            -- 食材
            arr = ItemM.getFoodMaterial();
            table.sort(arr);
            classId = arr[1 + seed % #arr];
            rank = ItemM.query(classId, "rank");
            local amountArr = { 80, 40, 15, 5};
            amount = amountArr[rank];
        elseif seed3 % 1000 < 700 then
            -- 炼金材料
            arr = ItemM.getAllAlchemy();
            table.sort(arr);
            classId = arr[1 + seed % #arr];
            rank = ItemM.query(classId, "rank");
            local amountArr = { 50, 15, 5, 2};
            amount = amountArr[rank];
        else
            -- 神器碎片
            arr = ArtifactM.getAllArtifactIds(true);
            table.sort(arr);
            classId = arr[1 + seed % #arr];
            amount = 5;
        end
    end

    return { 1, classId, amount };
end
